<?php

//防止恶意调用
if (!defined('IN_MOD'))
{
    die('Hacking attempt');
}

// 多语言栏目配置
if($configinfo['columninfo'][$configinfo['cat_id']] == $configinfo['langcolumnid'])
{
	// 栏目分类默认语言参数配置
	if(empty($configinfo['langok']) || $configinfo['langdefault'] == $lang)
	{
		$contenthtml = file_get_contents(MODULEPARA_PATH."/config/module/block/52/contentdefaulthtml.html");
		if($configinfo['tplok'] == 1)$contenthtml .= file_get_contents($configinfo['tplurl']."/config/module/block/52/contentdefaulthtml.html");// 加载模板程序配置
	}
	
	// 多语言栏目信息配置
	$parameter['listattr_name'] = $parameter['listattr_'.$listattrid.'_name'];
	$parameter['listattr_fname'] = $parameter['listattr_'.$listattrid.'_fname'];
	$parameter['listattr_description'] = $parameter['listattr_'.$listattrid.'_description'];
	$parameter['listattr_title'] = $parameter['listattr_'.$listattrid.'_title'];
	$parameter['listattr_keyword'] = $parameter['listattr_'.$listattrid.'_keyword'];
	$parameter['listattr_desc'] = $parameter['listattr_'.$listattrid.'_desc'];
	$parameter['listattr_bannerimg'] = $parameter['listattr_'.$listattrid.'_bannerimg'];
	if(empty($parameter['listattr_bannerimg']))
	{
		$parameter['listattr_bannerimg_url'] = "/themes/admin_simpleboot3/public/assets/images/default-thumbnail.png";
	}else{
		$parameter['listattr_bannerimg_url'] = cmf_get_image_preview_url($parameter['listattr_'.$listattrid.'_bannerimg']);
	}
	$parameter['listattr_content'] = stzhtml($parameter['listattr_'.$listattrid.'_content']);
	$parameter['listattr_contentmobile'] = stzhtml($parameter['listattr_'.$listattrid.'_contentmobile']);
	$parameter['listattr_columninfodata1'] = stzhtml($parameter['listattr_'.$listattrid.'_columninfodata1']);
	$parameter['listattr_columninfodata2'] = stzhtml($parameter['listattr_'.$listattrid.'_columninfodata2']);
	$parameter['listattr_columninfodata3'] = stzhtml($parameter['listattr_'.$listattrid.'_columninfodata3']);
}

// 网站基本配置
if($configinfo['columnid'] == 13)
{
	$colids = getstrtoarr(",",$configinfo['colids']);
	
	// 资讯动态缩略图配置
	if($configinfo['thumbconfig'][1] == 0 || in_array(1,$colids))
	{
		$thumbconfig1none = "style='display:none;'";
	}
	
	// 案例展示缩略图配置
	if($configinfo['thumbconfig'][2] == 0 || in_array(2,$colids))
	{
		$thumbconfig2none = "style='display:none;'";
	}
	
	// 产品管理缩略图配置
	if($configinfo['thumbconfig'][3] == 0 || in_array(3,$colids))
	{
		$thumbconfig3none = "style='display:none;'";
	}
	
	// 招聘管理缩略图配置
	if($configinfo['thumbconfig'][37] == 0 || in_array(37,$colids))
	{
		$thumbconfig37none = "style='display:none;'";
	}
	
	// 下载管理缩略图配置
	if($configinfo['thumbconfig'][82] == 0 || in_array(82,$colids))
	{
		$thumbconfig82none = "style='display:none;'";
	}
}

// SEO基本配置
if($configinfo['columnid'] == 87)
{
	// TAG标签
	if($configinfo['tagok'] == 0)
	{
		$tagnone = "display:none;";
	}	
	
	// 在线搜索
	if($configinfo['searchok'] == 0)
	{
		$searchnone = "display:none;";
	}	
	
	// 优化文字
	if($configinfo['seotextheadok'] == 0 && $configinfo['seotextfootok'] == 0)
	{
		$seotextnone = "display:none;";
	}	
	if($configinfo['seotextheadok'] == 0)
	{
		$seotextheadnone = "display:none;";
	}
	if($configinfo['seotextfootok'] == 0)
	{
		$seotextfootnone = "display:none;";
	}
}

// 订单管理配置
if($configinfo['columnid'] == 109)
{
	// 订单时间
	$parameter_default['create_time'] = date('Y-m-d H:i:s', $parameter_default['create_time']);
	$parameter_default['published_time'] = date('Y-m-d H:i:s', $parameter_default['published_time']);	
	
	// 订单状态
	$orderstatus = "orderstatus";
	if($parameter_default[$orderstatus] == 5)
	{
		$parameter_default['orderstatushtml'] = "<font color='red'>已取消</font>";
	}else if($parameter_default[$orderstatus] == 3)
	{
		$parameter_default['orderstatushtml'] = "<font color='red'>已完成</font>";
	}else if($parameter_default[$orderstatus] == 2)
	{
		$parameter_default['orderstatushtml'] = "已付款，已发货";
	}else if($parameter_default[$orderstatus] == 1)
	{
		$parameter_default['orderstatushtml'] = "已付款，待发货";	
	}else{
		$parameter_default['orderstatushtml'] = "未付款，未发货";		
	}
	// 操作状态
	if($parameter_default[$orderstatus] == 2)
	{
		$parameter_default['opstatus'] = "更多操作";
	}else if($parameter_default[$orderstatus] == 1)
	{
		$parameter_default['opstatus'] = "发货操作";	
	}else{
		$parameter_default['opstatus'] = "付款操作";		
	}
	
	// 订单商品
	$modulewhere=array();
	$modulewhere["tablename"]="modulepara_order_goods";
	$modulewhere["arrayclass"]=$dataid;
	$modulewhere["bigclassname"]="orderid";
	$modulewhere["order"]='default';
	$ordergoodslist=modulepara("configmodule",$modulewhere,1);
	foreach($ordergoodslist as $key=>$val)
	{
		$goods_attr = getstrtoarr(",",$val['goods_attr']);
		foreach($goods_attr as $k=>$v)
		{
			$pinfo = getstrtoarr("-",$v);
			$ordergoodslist[$key]["goods_attr_arr"][$pinfo[0]] = $pinfo[1];
		}
	}
		
	$ordergoodshtml = '<table cellpadding="2" cellspacing="1" border="0" width="100%" class="order_table">
						<tbody><tr>
						<td>商品名称</td>
						<td width="12%">商品货号</td>
						<td width="15%">商品单价</td>
						<td width="15%">赠送积分</td>
						<td width="10%">商品数量</td>
						</tr>';
	 foreach($ordergoodslist as $key=>$val)
	 {					
	     $ordergoodshtml .= '<tr>
							<td><a href="'.cmf_url('portal/Article/index',array('id'=>$val['listid'],'cid'=>$val['listcatid'])).'" title="'.$val['goods_name'].'" target="_blank"><img src="/upload/'.$val['goods_img'].'" style="float:left; margin-right:10px;" width="50" height="50"> 
							<p>'.$val['goods_name'].'</p>
							<p>';
		foreach($val['goods_attr_arr'] as $k=>$v)
	    {
			$ordergoodshtml .= '<span style="color:#888;">'.$k.'：'.$v.' | </span>';
		}
		$ordergoodshtml .= '</p>  
							</a></td>
							<td>'.$val['goods_sn'].'</td>
							<td>￥'.$val['price'].'</td>
							<td>'.$val['giveintegral'].' 积分</td>
							<td>'.$val['number'].'</td>
							</tr>';
	 }
	$ordergoodshtml .= '</tbody></table>';
}

?>